<!--

/*
* Copyright (C) 2005-2013 University of Sydney
*
* Licensed under the GNU License, Version 3.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.gnu.org/licenses/gpl-3.0.txt
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/

/**
* editRecStructure.html
* manages the structure of given rectype, edit properties for view  (width, label, order, tooltip)
* for fields and allows to preview the record's entry form on-fly,
* invokes selectDetailType.html - to add new detailtype into record structure
*
* @author      Artem Osmakov   <artem.osmakov@sydney.edu.au>
* @author      Ian Johnson   <ian.johnson@sydney.edu.au>
* @author      Stephen White   <stephen.white@sydney.edu.au>
* @copyright   (C) 2005-2013 University of Sydney
* @link        http://Sydney.edu.au/Heurist
* @version     3.1.0
* @license     http://www.gnu.org/licenses/gpl-3.0.txt GNU License 3.0
* @package     Heurist academic knowledge management system
* @subpackage  !!!subpackagename for file such as Administration, Search, Edit, Application, Library
*/

-->

<html>
    <head>
        <title>RECORD STRUCTURE</title>

        <meta http-equiv="content-type" content="text/html; charset=utf-8">
        <link rel="icon" href="../../../favicon.ico" type="image/x-icon">
        <link rel="shortcut icon" href="../../../favicon.ico" type="image/x-icon">

        <!-- YUI -->
        <link rel="stylesheet" type="text/css" href="../../../external/yui/2.8.2r1/build/fonts/fonts-min.css" />
        <link rel="stylesheet" type="text/css" href="../../../external/yui/2.8.2r1/build/treeview/assets/skins/sam/treeview.css" />
        <link rel="stylesheet" type="text/css" href="../../../external/yui/2.8.2r1/build/menu/assets/skins/sam/menu.css">

        <script type="text/javascript" src="../../../external/yui/2.8.2r1/build/yahoo-dom-event/yahoo-dom-event.js"></script>
        <script type="text/javascript" src="../../../external/yui/2.8.2r1/build/element/element-min.js"></script>
        <script type="text/javascript" src="../../../external/yui/2.8.2r1/build/container/container_core-min.js"></script>
        <script type="text/javascript" src="../../../external/yui/2.8.2r1/build/menu/menu-min.js"></script>

        <script type="text/javascript" src="../../../external/yui/2.8.2r1/build/yahoo/yahoo-min.js"></script>
        <script type="text/javascript" src="../../../external/yui/2.8.2r1/build/json/json-min.js"></script>

        <!-- link rel="stylesheet" type="text/css" href="../../external/yui/2.8.2r1/build/reset-fonts-grids/reset-fonts-grids.css"/ -->
        <!-- Skin CSS files resize.css must load before layout.css -->
        <link rel="stylesheet" type="text/css" href="../../../external/yui/2.8.2r1/build/assets/skins/sam/resize.css">
        <link rel="stylesheet" type="text/css" href="../../../external/yui/2.8.2r1/build/assets/skins/sam/layout.css">
        <!-- Utility Dependencies -->
        <script src="../../../external/yui/2.8.2r1/build/yahoo-dom-event/yahoo-dom-event.js"></script>
        <script src="../../../external/yui/2.8.2r1/build/dragdrop/dragdrop-min.js"></script>
        <script src="../../../external/yui/2.8.2r1/build/element/element-min.js"></script>
        <!-- Optional Animation Support-->
        <script src="../../../external/yui/2.8.2r1/build/animation/animation-min.js"></script>
        <!-- Optional Resize Support -->
        <script src="../../../external/yui/2.8.2r1/build/resize/resize-min.js"></script>
        <!-- Source file for the Layout Manager
        <script src="../../external/yui/2.8.2r1/build/layout/layout-min.js"></script>
        -->

        <!-- DATATABLE DEFS -->
        <link type="text/css" rel="stylesheet" href="../../../external/yui/2.8.2r1/build/datatable/assets/skins/sam/datatable.css">
        <!-- datatable Dependencies -->
        <script type="text/javascript" src="../../../external/yui/2.8.2r1/build/datasource/datasource-min.js"></script>
        <!-- OPTIONAL: Drag Drop (enables resizeable or reorderable columns) -->
        <script type="text/javascript" src="../../../external/yui/2.8.2r1/build/dragdrop/dragdrop-min.js"></script>
        <!-- Source files -->
        <script type="text/javascript" src="../../../external/yui/2.8.2r1/build/datatable/datatable-min.js"></script>
        <!-- END DATATABLE DEFS-->

        <!-- PAGINATOR
        <link rel="stylesheet" type="text/css" href="../../external/yui/2.8.2r1/build/paginator/assets/skins/sam/paginator.css">
        <script type="text/javascript" src="../../external/yui/2.8.2r1/build/paginator/paginator-min.js"></script>
         END PAGINATOR -->

        <link rel="stylesheet" type="text/css" href="../../../external/yui/2.8.2r1/samples/yui-dt-expandable.css"/>
        <script type="text/javascript" src="../../../external/yui/2.8.2r1/samples/yui-dt-expandable.js"></script>
        <!-- END YUI -->

        <script type="text/javascript" src="../../../external/jquery/jquery.js"></script>

        <link rel="stylesheet" type="text/css" href="../../../common/css/global.css">
        <link rel="stylesheet" type="text/css" href="../../../common/css/edit.css">
        <link rel="stylesheet" type="text/css" href="../../../common/css/admin.css">

        <style type="text/css">
            .input-row div.input-header-cell {vertical-align:baseline; width:100px}
            .dtyField {
                    padding-bottom: 3px;
                    padding-top: 3px;
                    display: block;
            }
            .dtyLabel {
                    display: inline-block;
                    width: 150px;
                    text-align: right;
                    padding-right: 3px;
            }
            .dtyValue {
                    display: inline-block;
            }
            /*.yui-dt table
            {
                    width: 590;
                    max-width: 590;
            }*/
            .yui-dt-highlighted {
            background-color: #000;
            color: #FFF;
            }
            .tooltip {
                    position:absolute;
                    z-index:999;
                    left:-9999px;
                    top:0px;
                    background-color:#dedede;
                    padding:5px;
                    border:1px solid #fff;
                    min-width:300;
                    min-height:300;
            }

            .depth0 {
                margin-left: 0px;
            }
            .depth1 {
                margin-left: 10px;
            }
            .depth2 {
                margin-left: 20px;
            }
            .depth3 {
                margin-left: 30px;
            }
            .depth4 {
                margin-left: 40px;
            }
            .depth5 {
                margin-left: 50px;
            }
            .depth6 {
                margin-left: 60px;
            }
            .depth7 {
                margin-left: 70px;
            }

            .termHeader {
                font-weight: bold;
                color: black;
            }
            .dtyName {
                text-align:left;
                padding-left: 10px;
                padding-bottom: 3px;
                padding-top: 3px;
                font-weight: 200;
            }

            /* grey rows in datatable */
            .yui-skin-sam .yui-dt tr.gray,
            .yui-skin-sam .yui-dt tr.gray td.yui-dt-asc,
            .yui-skin-sam .yui-dt tr.gray td.yui-dt-desc,
            .yui-skin-sam .yui-dt tr.gray td.yui-dt-asc,
            .yui-skin-sam .yui-dt tr.gray td.yui-dt-desc {
                color: #aaaaaa;
            }

            .yui-skin-sam .yui-dt-selected, .yui-skin-sam tr.yui-dt-selected td{
                background-color: #aaaaaa;
            }
        </style>
    </head>

    <body class="popup yui-skin-sam" style="overflow: auto;">
        <h2 id="recordTitle" style="margin:10px 0"></h2>
        <div id="page-inner" style="top:50px; bottom:60px;">
            <script type="text/javascript" src="../../../common/js/utilsLoad.js"></script>
            <script src="../../../common/php/displayPreferences.php"></script>
            <script src="../../../common/php/getMagicNumbers.php"></script>
            <script src="../../../common/php/loadCommonInfo.php"></script>

            <!-- script type="text/javascript" src="../../records/edit/editRecord.js"></script -->
            <script type="text/javascript" src="../../../records/edit/relationshipsObjectLibrary.js"></script>

            <script type="text/javascript" src="editRecStructure.js"></script>
            <script type="text/javascript" src="../terms/selectTerms.js"></script>
            <script type="text/javascript" src="../rectypes/selectRectype.js"></script>
            <script type="text/javascript" src="../../../common/js/utilsUI.js"></script>

            <!--  class="yui-navset yui-navset-top"  -->
            <div id="modelTabs" style="margin:auto;text-align:left;"></div>
        </div>

        <div style="bottom:10px;left:10px; right:10px;text-align:left; position:absolute;" id="recStrcuture_bottom">
            <span style="float:left">
                  <i>Click row to edit field specifications. Drag arrows at left to change the order in the form.</i>
                  <br/>
                  To see the effects of record structure changes on the data entry form, keep a record open in the record edit form<br/>
                  and simply hit Reload to view the revised form - changes here take effect immediately, there is no need to hit [Done]
            </span>

            <span style="float:right; text-align:right">
                <!--<input type="button" value="Back to list of record types" onClick="{window.history.back();}"/>-->
                <!-- input type="button" value="Preview" onClick="editStructure.initPreview()"/ -->
                <input type="button" value="Done" onClick="editStructure.closeWin();"/>
            </span>
        </div>

        <div style="display: none;text-align:center; padding:5px; width:90%" id="dlgWrongTitleMask">
            The current title mask appears to be invalid.
            This generally means that fields used in the mask have been removed from the record structure.
            A valid title mask is essential for display of the record in search results.
            <div style="padding-top: 10px;">
                <input style="margin-right: 10px;" type="button" value="Fix title mask"
                    onClick="{top.HEURIST.util.popups.list[top.HEURIST.util.popups.list.length-1].opener.editStructure.doEditTitleMask();}"/>
            </div>
        </div>

        <script  type="text/javascript">
            //
            //  starts initialization on load completion of this window
            //
            YAHOO.util.Event.addListener(window, "load", function(){  editStructure = new  EditRecStructure(); });
        </script>
    </body>
</html>